//
//  TSCMySpinner2.h
//  Tsc_IOS
//
//  Created by Rio on 15-5-27.
//  Copyright (c) 2015年 idream. All rights reserved.
//

@class TSCMySpinner;

typedef UITableViewCell * (^BCellCreator)(UITableView *, NSIndexPath *);
typedef void (^BCellModifier)(UITableView *, UITableViewCell *, NSIndexPath *); // 简版。默认认为dataArray中还是NSString，且使用默认风格，只不过最后把创建好的默认cell再加工一下（比如增加个tag）
typedef void(^BSpinnerItemSelectedListener)(TSCMySpinner *, UITableViewCell *, NSIndexPath *);

#import <UIKit/UIKit.h>

@interface TSCMySpinner : UIView <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UIFont * font; // 其实是btn的title的font
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, strong) BCellCreator cellCreator;
@property (nonatomic, strong) BCellModifier cellModifier;
@property (nonatomic, strong) BSpinnerItemSelectedListener itemSelectedListener;

- (void) prepareData_P1:(void(^)())preparingHandler completionHandler:(void(^)())completionHandler;
- (void) cleanData;
- (void) applyData;

- (NSIndexPath *) getSelectedIndexPath;
- (id) getSelectedObject;

- (void) setSelectedItem:(NSInteger)selectedItemIndex;

@end
